feat(observability): Langfuse Agent-Graph-view metadata + host span-metadata injector#11
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6e98e8adf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if request.messages[i].text() == self.placeholder { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Don't skip compaction from text alone
When an older Message::Tool contains non-text ContentBlocks plus text equal to the placeholder (or when the placeholder is empty and the tool body is structured-only), this check treats it as already compacted and leaves the original content blocks in place. Since Message supports JSON/image/provider-extension blocks and this middleware promises to blank stale tool-result bodies, those payloads can remain in the transcript for downstream middleware or providers that preserve structured content; only skip when the actual tool content is exactly a single placeholder text block.
Useful? React with 👍 / 👎.
…n-metadata injector on graph Langfuse exporter - node spans now carry langgraph_node (node id) and langgraph_step (superstep index) in metadata so Langfuse's Agent Graph view can lay the trace out as a graph; step spans carry langgraph_step; subgraph spans carry langgraph_step from their coordinate observation - GraphLangfuseExporter::with_span_metadata_fn installs an optional host metadata injector (Fn(&GraphObservation) -> Option<Map>) merged over built-in span metadata keys (host wins on collision); default None, non-breaking - re-export SpanMetadataFn from graph/observability, graph, and crate root Claude-Session: https://claude.ai/code/session_01VSwRwLDBXg3o6timchvKn8
d6e98e8 to
60e9701
Compare
What
Two additions to
GraphLangfuseExporter(src/graph/observability/langfuse.rs), both non-breaking:langgraph_node(node id) andlanggraph_step(superstep index); step and subgraph spans carrylanggraph_step. Langfuse's Agent Graph view is keyed to these LangGraph metadata conventions, so stamping them makes Langfuse render our graph runs natively in the graph visualization.GraphLangfuseExporter::with_span_metadata_fn(Fn(&GraphObservation) -> Option<Map>)lets hosts merge extra per-span metadata (host keys win on collision; spans only, point events untouched). Previously span metadata was hardcoded with no extension point.SpanMetadataFnis re-exported from the module,graph, and crate root.Why
Part of the Langfuse observability overhaul across the OpenHuman stack: openhuman is wiring flow/graph runs into Langfuse via this exporter (companion PRs: tinyhumansai/tinyflows journaled-run entry points, tinyhumansai/openhuman flows-domain export hook, tinyhumansai/backend#1069). Without these keys the Langfuse Agent Graph view cannot render our graphs; without the injector the host cannot stamp flow-level attribution (e.g. flow_id) per span.
Testing
cargo test --lib graph::observability— 23 passed, 0 failed (3 new tests: langgraph keys on node/step spans, subgraph step key, injector merge/override + point-event isolation).https://claude.ai/code/session_01VSwRwLDBXg3o6timchvKn8